dofile ("libGame.lua")

bg = Image.load ("images/bg.png", VRAM)
mf = Image.load ("images/floor.png", VRAM)
pf = Image.load ("images/platform.png", VRAM)

Game.Platform.initPlatform (SCREEN_UP, 0, 0)
Game.Platform.newHero (5, 101, 24, 32, VRAM, 300, "images/mario.png")
Game.Platform.newBlock (0, 132, mf, "floor", true)
Game.Platform.newBlock (96, 90, pf, "platform", false)
Game.Platform.newBlock (234, 124, pf, "other", false)

while not Keys.held.Start do
  
  Controls.read ()
  
  Game.Platform.initHeroCommands (1)
  
  startDrawing ()
    
    screen.blit (SCREEN_UP, 0, 0, bg)
    
    Game.Platform.drawHero ()
    Game.Platform.drawBlock ("floor")
    Game.Platform.drawBlock ("other")
    Game.Platform.drawBlock ("platform")
    
    Game.Platform.debug ()
    -- Encore du debug !!! :
    Game.Platform.debugRects ("_hero_")
    Game.Platform.debugRects ("floor")
    Game.Platform.debugRects ("platform")
    Game.Platform.debugRects ("other")
    
  stopDrawing ()
  
end

Game.clearMemory ()

Image.destroy (bg)
Image.destroy (mf)
Image.destroy (pf)
bg = nil
mf = nil
pf = nil
